<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
  xmlns:p="http://primefaces.org/ui">

<ui:composition template="/templates/basic.xhtml">
  <f:metadata>
    <f:event type="preRenderView" listener="#{eventTasksBean.startConversation}" />
  </f:metadata>
  <ui:define name="Content">
    <h:form prependId="false">
      <p:dataTable id="EventTaskGrid" var="item" value="#{eventTasksBean.eventTasks}" paginator="true" rows="10"
        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}">

        <p:column>
          <f:facet name="header">
            <h:outputText value="#{msg.insertDate}" />
          </f:facet>
          <h:outputText value="#{item.insertDate}">
            <f:convertDateTime pattern="#{patternsBean.patterns.TIMESTAMP}" />
          </h:outputText>
        </p:column>

        <p:column>
          <f:facet name="header">
            <h:outputText value="#{msg.updateDate}" />
          </f:facet>
          <h:outputText value="#{item.updateDate}">
            <f:convertDateTime pattern="#{patternsBean.patterns.TIMESTAMP}" />
          </h:outputText>
        </p:column>

        <p:column>
          <f:facet name="header">
            <h:outputText value="#{msg.group}" />
          </f:facet>
          <h:outputText value="#{item.eventGroup}" />
        </p:column>

        <p:column>
          <f:facet name="header">
            <h:outputText value="#{msg.name}" />
          </f:facet>
          <h:outputText value="#{item.eventName}" />
        </p:column>

        <p:column>
          <f:facet name="header">
            <h:outputText value="#{msg.date}" />
          </f:facet>
          <h:outputText value="#{item.eventDate}">
            <f:convertDateTime pattern="#{patternsBean.patterns.DATE_SHORT}" />
          </h:outputText>
        </p:column>

        <p:column>
          <f:facet name="header">
            <h:outputText value="#{msg.hour}" />
          </f:facet>
          <h:outputText value="#{item.eventDate}">
            <f:convertDateTime pattern="#{patternsBean.patterns.HOUR_MIN}" />
          </h:outputText>
        </p:column>

      </p:dataTable>
      <br />
      <p:commandButton update="Log EventTaskGrid" action="#{eventTasksBean.importEventTasks}" />
      <br />
      <h:panelGroup id="Log">
        <ui:repeat var="entry" value="#{eventTasksBean.log.entries}">
          <h:outputText value="#{entry.message}" styleClass="#{entry.styleClass}" />
          <br />
          <ui:repeat var="detail" value="#{entry.detailMessages}">
            <h:outputText value="#{detail}" styleClass="#{entry.detailStyleClass}" />
            <br />
          </ui:repeat>
        </ui:repeat>
      </h:panelGroup>
    </h:form>
  </ui:define>
</ui:composition>

</html>